package com.apes.fico.finance.model.statements;


import com.apes.fico.masterdata.gl.model.AccountingModel;
import com.apes.framework.jpa.ApesBean;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.plugin.soe.annotations.State;
import com.apes.framework.plugin.soe.annotations.States;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @program: apestech
 * @description: 现金流量表
 * @author: PengZiFeng
 * @create: 2021-08-03 16:41
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = CashFlowStatement.CONST_TABLE_NAME)
public class CashFlowStatement extends Model {
    public final static String CONST_TABLE_NAME = "gl_cash_flow_statement";

    @Id
    @Column(name = "id", nullable = false, length = 32)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "现金流量表", padding = 8)
    @Comment("编号")
    private String id;

    @Column(name = "project_num")
    @Comment("项目编号")
    private String projectNum;

    @Column(name = "project_name")
    @Comment("项目名称")
    private String projectName;

    @Column(name = "project_type")
    @Comment("项目类型")
    private Integer projectType;

    @Column(name = "sequence")
    @Comment("行次")
    private String sequence;

    @Column(name = "equation")
    @Comment("公式")
    private String equation;

    @Column(name = "project_formula")
    @Comment("项目公式")
    private String projectFormula;

    @Column(name = "offset_formula")
    @Comment("冲抵公式")
    private String offsetFormula;

    @Column(name = "operator", length = 1)
    @Comment("运算符号")
    @States(name = "运算符号", values = {
            @State(id = AccountingModel.PLUS, name = "+"),
            @State(id = AccountingModel.MINUS, name = "-")})
    private String orientation;

}
